package com.ste.server;

import java.io.IOException;
import java.net.Socket;
import java.util.logging.Logger;

import com.ste.domain.Client;

public class ClientHandler implements Runnable {

	private Socket socket;
	private Server server;
	private static Logger log = Logger.getLogger(ReadClient.class.getName());
	public ClientHandler(Socket socket, Server server) {
		this.socket = socket;
		this.server = server;
	}

	@Override
	public void run() {
		try {
			Client client = new Client(server, null, socket);
			System.out.println("Client connected");
			server.addClient(client);
			client.start();
		} catch (IOException e) {
			log.info("Client out");
		} 
	}

}
